DemoCtrl.$inject = ['$rootScope', '$scope', 'IHttp', 'toastr'];

module.exports = DemoCtrl;

function DemoCtrl($rootScope, $scope, IHttp, toastr) {
    // io select
    $scope.shopArr = [{
        id: 1,
        name: 'toy'
    }, {
        id: 2,
        name: 'mona'
    }, {
        id: 3,
        name: 'sky'
    }, {
        id: 4,
        name: 'dail'
    }, {
        id: 5,
        name: 'shine'
    }];

    // toastr
    toastr.info('What a nice apple button', 'Button spree', {
        closeButton: true,
        closeHtml: '<button>X</button>',
        positionClass: 'toast-bottom-left'
    });

    // zTree
    $('#tree').css({
        'width': '200px',
        'height': '400px'
    });

    $scope.$watch('selectedModel', function(n) {
        if (!n) return;
        $scope.selectedModelStr = JSON.stringify({
            id: n.id,
            pId: n.pId,
            name: n.name
        });
    });

    $scope.zNodes = [{
        id: 1,
        pId: 0,
        name: "父节点1",
        open: true
    }, {
        id: 11,
        pId: 1,
        name: "父节点 1-1",
        open: true
    }];

    $scope.config = { };
}